//
//  GLView.h
//  Lesson 9
//
//  Created by wq on 11-8-26.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import <OpenGLES/EAGL.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>

@class GLViewController;
@interface GLView : UIView {
	EAGLContext *context;
	
	GLuint frameBuffer;
	GLuint renderBuffers[2];
	
	GLViewController *viewCtrl;
}

@property(nonatomic, retain) EAGLContext *context;
@property(nonatomic, assign) GLViewController *viewCtrl;

-(void)initViewport;
-(BOOL)presentRenderbuffer;

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;

@end
